package ${servicePackage};
#parse("/template/func.vm") #set ($className =  $table.className)
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.ui.ModelMap;
import ${comonPath}.common.components.DataGrid;
import ${comonPath}.common.components.DataGridJson;
import ${entityPackage}.${className};
import ${page};

/**
 * @ClassName: ${className}Service
 * @Description: $!table.remark
 * @author: $author
 * @version:v1.0.0
 * @date: $now
 * @Copyright $copyright
 */
public interface ${className}Service {
	
    /**
     * @param #uncap_first(${className}) ${className}参数
     * @return int 结果个数
     * @Title #uncap_first(${className})Service.count
     * @Description: 根据查询条件，计算${className}个数   ($table.tableName)
     */
    public int count(${className} #uncap_first(${className}));
    /**
     * @param #uncap_first(${className}) ${className}参数
     * @return void
     * @Title #uncap_first(${className})Service.saveSelective
     * @Description: 保存${className}, 只插入${className}的非空字段 ($table.tableName)
     */
    public int save(${className} #uncap_first(${className}));
    /**
     * @param #uncap_first(${className}) ${className}参数
     * @return void
     * @Title #uncap_first(${className})Service.saveSelective
     * @Description: 保存${className}, 只插入${className}的非空字段 ($table.tableName)
     */
    public int saveSelective(${className} #uncap_first(${className}));
    /**
     * @param #uncap_first(${className}) ${className}参数，查询条件
     * @return void
     * @Title #uncap_first(${className})Service.delete
     * @Description: 根据查询条件，删除 #uncap_first(${className}) ($table.tableName)

     */
    public int delete(${className} #uncap_first(${className}));
    /**
     * @param #ID_NAME 主键
     * @return void
     * @Title #uncap_first(${className})Service.deleteByPrimaryKey
     * @Description: 修改${className} ($table.tableName)
     */
    public int deleteByPrimaryKey(#ID_TYPE_NAME);
    /**
     * @param #uncap_first(${className}) ${className}参数
     * @return void
     * @Title #uncap_first(${className})Service.updateByPrimaryKey
     * @Description: 修改${className}, 根据主键修改 ($table.tableName)
     */
    public int updateByPrimaryKey(${className} #uncap_first(${className}));
    /**
     * @param #uncap_first(${className}) ${className}参数
     * @return void
     * @Title #uncap_first(${className})Service.updateSelectiveByPrimaryKey
     * @Description: 修改${className}, 根据主键修改，只修改非空参数字段 ($table.tableName)
     */
    public int updateSelectiveByPrimaryKey(${className} #uncap_first(${className}));
    /**
     * @param update    ${className}参数需改的值
     * @param #uncap_first(${className}) ${className}查询条件
     * @return void
     * @Title #uncap_first(${className})Service.update
     * @Description: 修改${className}, 根据查询条件修改 ($table.tableName)
     */
    public int update(${className} update, ${className} conditon);
    /**
     * @param update    ${className}参数需改的值
     * @param #uncap_first(${className}) ${className}查询条件
     * @return void
     * @Title #uncap_first(${className})Service.updateSelective
     * @Description: 修改${className}, 根据查询条件修改 ($table.tableName)
     */
    public int updateSelective(${className} update, ${className} conditon);
    /**
     * @param #ID_NAME 主键
     * @return ${className}参数
     * @Title #uncap_first(${className})Service.selectByPrimaryKey
     * @Description: 根据主键，返回${className} ($table.tableName)
     */
    public ${className} selectByPrimaryKey(#ID_TYPE_NAME);
    /**
     * @param #uncap_first(${className}) ${className}参数，查询条件
     * @return List<${className}> ${className}结果集 [不分页]
     * @Title #uncap_first(${className})Service.selectAll
     * @Description: 根据查询条件类，返回${className}结果集 ($table.tableName)
     */
    public List<${className}> selectAll(${className} #uncap_first(${className}));
    /**
     * @param #uncap_first(${className}) ${className}参数，查询条件
     * @param page Page参数，分页条件
     * @return Page<${className}> ${className}结果集
     * @Title #uncap_first(${className})Service.selectByPage
     * @Description: 根据查询条件类，返回${className}结果集 [分页] ($table.tableName)
     */
    public Page<${className}> selectByPage(${className} #uncap_first(${className}), Page page);
    /**
     * @param  #uncap_first(${className}) ${className}参数，查询条件
     * @param  DataGrid DataGrid参数，分页条件
     * @return DataGridJson<${className}> ${className}结果集
     * @Title  #uncap_first(${className})Service.selectByPageJson
     * @Description: 根据查询条件类，返回${className}结果集 [分页] ($table.tableName)
     */
     public DataGridJson selectByPageJson(HttpServletRequest request ,${className} #uncap_first(${className}),Page page, DataGrid dg ,ModelMap mMap);
 	/**
 	 * @param  Map 参数，查询条件
 	 * @param  DataGrid DataGrid参数，分页条件
 	 * @return DataGridJson<${className}> ${className}结果集
 	 * @Title  #uncap_first(${className})Service.selectByPageMap
 	 * @Description: 根据查询条件类，返回${className}结果集 [分页] ($table.tableName)
 	 */
     public Page<Map<String, String>> selectByPageMap(HttpServletRequest request, Page<Map<String, String>> page ,DataGrid dg ,ModelMap mMap);

}